def first(word):
    return word[0]

def last(word):
    return word[-1]

def middle(word):
    return word[1:-1]

def is_palindrome(string):
    if len(string) <= 1:
        return True

    if first(string) != last(string):
        return False

    print string
    return is_palindrome(middle(string))


print is_palindrome('lasalasal')


def gcd(a, b):

    if b == 0:
        return a

    r = a / b

    return gcd(b, r)


print gcd(1234,3)